package org.wk.core.web.unitofwork;

import java.util.ArrayList;
import java.util.List;

import org.springframework.util.Assert;

public class UnitOfWorkException extends RuntimeException {
	/**
	* @Fields serialVersionUID: long
	* @Desc TODO: 
	*/
	private static final long serialVersionUID = 1L;
	private List<Exception> processExceptions = new ArrayList<Exception>();
	private Exception rollbackException;
	public UnitOfWorkException(Exception processException){
		Assert.notNull(processException);
		this.processExceptions.add(processException);
	}
	public void addProcessException(Exception processException) {
		Assert.notNull(processException);
		this.processExceptions.add(processException);
	}
	public void setRollbackException(Exception rollbackException) {
		Assert.notNull(rollbackException);
		this.rollbackException=rollbackException;
	}
	public List<Exception> getProcessExceptions() {
		return processExceptions;
	}
	public Exception getRollbackException() {
		return rollbackException;
	}
}
